/*
 * CycleTargetArea.h
 *
 *  Created on: 2010-mar-15
 *      Author: he huang
 */

#ifndef CYCLETARGETAREA_H_
#define CYCLETARGETAREA_H_

#include <omnetpp.h>
#include "Coordinates.h"
#include "Split.h"

class CycleTargetArea {
public:

	CycleTargetArea();

	CycleTargetArea(const Coordinates &center, double radius);

	CycleTargetArea(const CycleTargetArea &area);

	virtual ~CycleTargetArea();

	virtual Side onWhichSide( const Split &split );

	virtual int sizeInBits();

    const Coordinates& getCenter() const
    {
        return *_center;
    }

    double getRadius() const
    {
        return _radius;
    }

    CycleTargetArea& operator=(const CycleTargetArea& other);

    friend std::ostream& operator<<(std::ostream& Stream, const CycleTargetArea& v);
    void netPack(cCommBuffer *b);
    void netUnpack(cCommBuffer *b);

private:
	Coordinates *_center; // center point of the cycle area
	double _radius; // radius of the cycle area
};

inline void doPacking(cCommBuffer *b, CycleTargetArea& obj) {obj.netPack(b);}

inline void doUnpacking(cCommBuffer *b, CycleTargetArea& obj) {obj.netUnpack(b);}

#endif /* CYCLETARGETAREA_H_ */

